<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>头部显示</title>

  </head>
  
  <body>
   <jsp:useBean id="user" class="servlet.User" scope="session"></jsp:useBean>
    <%
    if(user.getUsername()==null) {//实例化user对象
     %>
     <jsp:forward page="login.jsp"></jsp:forward>
     <%} %>
    欢迎<jsp:getProperty property="username" name="user"/>访问系统!  登录时间是：
    <jsp:getProperty property="loginTime" name="user"/><br>
  </body>
</html>
